package com.horay.springclouddemo.stream.singleton.provider.controller;

import com.horay.springclouddemo.stream.singleton.provider.message.MessageProvider;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 消息提供者控制器
 *
 * @author heyingcheng
 * @date 2020/3/28 20:09
 */
@RestController
@RequestMapping("message/provider")
public class MessageProviderController {

    private final MessageProvider messageProvider;

    public MessageProviderController(MessageProvider messageProvider) {
        this.messageProvider = messageProvider;
    }

    @GetMapping
    public String sendMessage() {
        return messageProvider.send();
    }

}
